﻿@model IEnumerable<FCNS.ERP.Models.ErpSeatPlan>

@{
    ViewBag.Title = "枱号预定";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="~/Content/Food/food.css" rel="stylesheet" />
<script src="~/Scripts/Erp/food.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $(".orderStart").click(function () {
            if ($(this).attr("data-status") == "空闲") {
                OrderFoodNew($(this).attr("data-id"),$(this).attr("value"));
            }
            else
            {
                alert("当前枱号未结单！");
            }
        });
    });
</script>
<h2>@ViewBag.Title</h2>

<p>
    <a class="newObjA" href="/Food/SeatPlanNew">新增</a>
</p>

<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.SalesmanId)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.SeatId)
        </th> 
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Tel)
        </th> 
        <th>
            @Html.DisplayNameFor(model => model.NumberOfPeople)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.DateTimeStart)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Salesman.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Seat.Name)
        </td> 
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Tel)
        </td> 
        <td>
            @Html.DisplayFor(modelItem => item.NumberOfPeople)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DateTimeStart)
        </td>
        <td>
            <label value=@item.Id class="orderStart" data-id="@item.Seat.Id" data-status="@item.Seat.Status">开单</label>|
            <a href="SeatPlanDelete/@item.Id" class="objDelete">删除</a>
        </td>
    </tr>
}

</table>
